package com.hdax.dmw.scheduler.api;

import com.hdax.dmw.dtos.scheduler.TimePlanDto;
import com.hdax.dmw.scheduler.service.DmSchedulerService;
import com.hdax.dmw.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping(path = "/desc")
public class TimPlanApi {

    @Autowired
    private DmSchedulerService schedulerService;

    @PostMapping(path = "/getTimePlan")
    public Result<List<TimePlanDto>> getTimePlan(@RequestBody Map<String, Long> params){
        //商品id
        Long itemId = params.get("itemId");

        return schedulerService.getTimePlan(itemId);
    }
}
